// SquareLine LVGL GENERATED FILE
// EDITOR VERSION: SquareLine Studio 1.0.0
// LVGL VERSION: 8.2
// PROJECT: App_GUI

#include "ui.h"
#include "ui_helpers.h"

///////////////////// VARIABLES ////////////////////
lv_obj_t * ui_ScreenMAIN;
lv_obj_t * ui_Label1;
lv_obj_t * ui_Label2;
lv_obj_t * ui_LabelRS485CODE;
lv_obj_t * ui_Label3;
lv_obj_t * ui_LabelL1;
lv_obj_t * ui_LabelL2;
lv_obj_t * ui_LabelL3;
lv_obj_t * ui_LabelL4;
lv_obj_t * ui_LabelL5;
lv_obj_t * ui_LabelL6;
lv_obj_t * ui_LabelL7;
lv_obj_t * ui_LabelL8;
lv_obj_t * ui_LabelR1;
lv_obj_t * ui_LabelR2;
lv_obj_t * ui_LabelR3;
lv_obj_t * ui_LabelR4;
lv_obj_t * ui_LabelR5;
lv_obj_t * ui_LabelR6;
lv_obj_t * ui_LabelR7;
lv_obj_t * ui_LabelR8;
lv_obj_t * ui_ScreenSTARTUP;
lv_obj_t * ui_Label4;
lv_obj_t * ui_Spinner1;
lv_obj_t * ui_Label4_copy;

///////////////////// ANIMATIONS ////////////////////

//
// FUNCTION HEADER
void Anim_startup_Animation(lv_obj_t * TargetObject, int delay);

// FUNCTION
void Anim_startup_Animation(lv_obj_t * TargetObject, int delay)
{

    //
    lv_anim_t PropertyAnimation_0;
    lv_anim_init(&PropertyAnimation_0);
    lv_anim_set_time(&PropertyAnimation_0, 1000);
    lv_anim_set_user_data(&PropertyAnimation_0, TargetObject);
    lv_anim_set_custom_exec_cb(&PropertyAnimation_0, _ui_anim_callback_set_opacity);
    lv_anim_set_values(&PropertyAnimation_0, 0, 255);
    lv_anim_set_path_cb(&PropertyAnimation_0, lv_anim_path_ease_in);
    lv_anim_set_delay(&PropertyAnimation_0, delay + 0);
    lv_anim_set_early_apply(&PropertyAnimation_0, true);
    lv_anim_set_get_value_cb(&PropertyAnimation_0, &_ui_anim_callback_get_opacity);
    lv_anim_start(&PropertyAnimation_0);

}

///////////////////// FUNCTIONS ////////////////////

///////////////////// SCREENS ////////////////////
void ui_ScreenMAIN_screen_init(void)
{

    // ScreenMAIN

    ui_ScreenMAIN = lv_obj_create(NULL);

    lv_obj_clear_flag(ui_ScreenMAIN, LV_OBJ_FLAG_SCROLLABLE);

    // Label1

    ui_Label1 = lv_label_create(ui_ScreenMAIN);

    lv_obj_set_width(ui_Label1, LV_SIZE_CONTENT);
    lv_obj_set_height(ui_Label1, LV_SIZE_CONTENT);

    lv_obj_set_x(ui_Label1, 0);
    lv_obj_set_y(ui_Label1, -145);

    lv_obj_set_align(ui_Label1, LV_ALIGN_CENTER);

    lv_label_set_recolor(ui_Label1, true);

    lv_label_set_text(ui_Label1, "#0000ff ---- ZRR-ServoDriver ----#");

    lv_obj_clear_flag(ui_Label1, LV_OBJ_FLAG_CLICKABLE);

    // Label2

    ui_Label2 = lv_label_create(ui_ScreenMAIN);

    lv_obj_set_width(ui_Label2, LV_SIZE_CONTENT);
    lv_obj_set_height(ui_Label2, LV_SIZE_CONTENT);

    lv_obj_set_x(ui_Label2, 0);
    lv_obj_set_y(ui_Label2, -115);

    lv_obj_set_align(ui_Label2, LV_ALIGN_CENTER);

    lv_label_set_recolor(ui_Label2, true);

    lv_label_set_text(ui_Label2, "#ff0000 - JSON code -#");

    lv_obj_clear_flag(ui_Label2, LV_OBJ_FLAG_CLICKABLE);

    // LabelRS485CODE

    ui_LabelRS485CODE = lv_label_create(ui_ScreenMAIN);

    lv_obj_set_width(ui_LabelRS485CODE, 220);
    lv_obj_set_height(ui_LabelRS485CODE, LV_SIZE_CONTENT);

    lv_obj_set_x(ui_LabelRS485CODE, -2);
    lv_obj_set_y(ui_LabelRS485CODE, -65);

    lv_obj_set_align(ui_LabelRS485CODE, LV_ALIGN_CENTER);

    lv_label_set_text(ui_LabelRS485CODE,
                      "2333\n1024 1024 1024 1024 1024 1024 1024 1024\n1024 1024 1024 1024 1024 1024 1024 1024");

    lv_obj_clear_flag(ui_LabelRS485CODE, LV_OBJ_FLAG_CLICKABLE);

    // Label3

    ui_Label3 = lv_label_create(ui_ScreenMAIN);

    lv_obj_set_width(ui_Label3, LV_SIZE_CONTENT);
    lv_obj_set_height(ui_Label3, LV_SIZE_CONTENT);

    lv_obj_set_x(ui_Label3, 0);
    lv_obj_set_y(ui_Label3, -6);

    lv_obj_set_align(ui_Label3, LV_ALIGN_CENTER);

    lv_label_set_recolor(ui_Label3, true);

    lv_label_set_text(ui_Label3, "#ff0000 - Servo states -#");

    lv_obj_clear_flag(ui_Label3, LV_OBJ_FLAG_CLICKABLE);

    // LabelL1

    ui_LabelL1 = lv_label_create(ui_ScreenMAIN);

    lv_obj_set_width(ui_LabelL1, LV_SIZE_CONTENT);
    lv_obj_set_height(ui_LabelL1, LV_SIZE_CONTENT);

    lv_obj_set_x(ui_LabelL1, -82);
    lv_obj_set_y(ui_LabelL1, 20);

    lv_obj_set_align(ui_LabelL1, LV_ALIGN_CENTER);

    lv_label_set_recolor(ui_LabelL1, true);

    lv_label_set_text(ui_LabelL1, "L-1 : 1024");

    lv_obj_clear_flag(ui_LabelL1, LV_OBJ_FLAG_CLICKABLE);

    lv_obj_set_style_text_align(ui_LabelL1, LV_TEXT_ALIGN_LEFT, LV_PART_MAIN | LV_STATE_DEFAULT);

    // LabelL2

    ui_LabelL2 = lv_label_create(ui_ScreenMAIN);

    lv_obj_set_width(ui_LabelL2, LV_SIZE_CONTENT);
    lv_obj_set_height(ui_LabelL2, LV_SIZE_CONTENT);

    lv_obj_set_x(ui_LabelL2, -2);
    lv_obj_set_y(ui_LabelL2, 20);

    lv_obj_set_align(ui_LabelL2, LV_ALIGN_CENTER);

    lv_label_set_recolor(ui_LabelL2, true);

    lv_label_set_text(ui_LabelL2, "L-2 : 1024");

    lv_obj_clear_flag(ui_LabelL2, LV_OBJ_FLAG_CLICKABLE);

    lv_obj_set_style_text_align(ui_LabelL2, LV_TEXT_ALIGN_LEFT, LV_PART_MAIN | LV_STATE_DEFAULT);

    // LabelL3

    ui_LabelL3 = lv_label_create(ui_ScreenMAIN);

    lv_obj_set_width(ui_LabelL3, LV_SIZE_CONTENT);
    lv_obj_set_height(ui_LabelL3, LV_SIZE_CONTENT);

    lv_obj_set_x(ui_LabelL3, 76);
    lv_obj_set_y(ui_LabelL3, 20);

    lv_obj_set_align(ui_LabelL3, LV_ALIGN_CENTER);

    lv_label_set_recolor(ui_LabelL3, true);

    lv_label_set_text(ui_LabelL3, "L-3 : 1024");

    lv_obj_clear_flag(ui_LabelL3, LV_OBJ_FLAG_CLICKABLE);

    lv_obj_set_style_text_align(ui_LabelL3, LV_TEXT_ALIGN_LEFT, LV_PART_MAIN | LV_STATE_DEFAULT);

    // LabelL4

    ui_LabelL4 = lv_label_create(ui_ScreenMAIN);

    lv_obj_set_width(ui_LabelL4, LV_SIZE_CONTENT);
    lv_obj_set_height(ui_LabelL4, LV_SIZE_CONTENT);

    lv_obj_set_x(ui_LabelL4, -80);
    lv_obj_set_y(ui_LabelL4, 43);

    lv_obj_set_align(ui_LabelL4, LV_ALIGN_CENTER);

    lv_label_set_recolor(ui_LabelL4, true);

    lv_label_set_text(ui_LabelL4, "L-4 : 1024");

    lv_obj_clear_flag(ui_LabelL4, LV_OBJ_FLAG_CLICKABLE);

    lv_obj_set_style_text_align(ui_LabelL4, LV_TEXT_ALIGN_LEFT, LV_PART_MAIN | LV_STATE_DEFAULT);

    // LabelL5

    ui_LabelL5 = lv_label_create(ui_ScreenMAIN);

    lv_obj_set_width(ui_LabelL5, LV_SIZE_CONTENT);
    lv_obj_set_height(ui_LabelL5, LV_SIZE_CONTENT);

    lv_obj_set_x(ui_LabelL5, -2);
    lv_obj_set_y(ui_LabelL5, 43);

    lv_obj_set_align(ui_LabelL5, LV_ALIGN_CENTER);

    lv_label_set_recolor(ui_LabelL5, true);

    lv_label_set_text(ui_LabelL5, "L-5 : 1024");

    lv_obj_clear_flag(ui_LabelL5, LV_OBJ_FLAG_CLICKABLE);

    lv_obj_set_style_text_align(ui_LabelL5, LV_TEXT_ALIGN_LEFT, LV_PART_MAIN | LV_STATE_DEFAULT);

    // LabelL6

    ui_LabelL6 = lv_label_create(ui_ScreenMAIN);

    lv_obj_set_width(ui_LabelL6, LV_SIZE_CONTENT);
    lv_obj_set_height(ui_LabelL6, LV_SIZE_CONTENT);

    lv_obj_set_x(ui_LabelL6, 77);
    lv_obj_set_y(ui_LabelL6, 43);

    lv_obj_set_align(ui_LabelL6, LV_ALIGN_CENTER);

    lv_label_set_recolor(ui_LabelL6, true);

    lv_label_set_text(ui_LabelL6, "L-6 : 1024");

    lv_obj_clear_flag(ui_LabelL6, LV_OBJ_FLAG_CLICKABLE);

    lv_obj_set_style_text_align(ui_LabelL6, LV_TEXT_ALIGN_LEFT, LV_PART_MAIN | LV_STATE_DEFAULT);

    // LabelL7

    ui_LabelL7 = lv_label_create(ui_ScreenMAIN);

    lv_obj_set_width(ui_LabelL7, LV_SIZE_CONTENT);
    lv_obj_set_height(ui_LabelL7, LV_SIZE_CONTENT);

    lv_obj_set_x(ui_LabelL7, -81);
    lv_obj_set_y(ui_LabelL7, 66);

    lv_obj_set_align(ui_LabelL7, LV_ALIGN_CENTER);

    lv_label_set_recolor(ui_LabelL7, true);

    lv_label_set_text(ui_LabelL7, "L-7 : 1024");

    lv_obj_clear_flag(ui_LabelL7, LV_OBJ_FLAG_CLICKABLE);

    lv_obj_set_style_text_align(ui_LabelL7, LV_TEXT_ALIGN_LEFT, LV_PART_MAIN | LV_STATE_DEFAULT);

    // LabelL8

    ui_LabelL8 = lv_label_create(ui_ScreenMAIN);

    lv_obj_set_width(ui_LabelL8, LV_SIZE_CONTENT);
    lv_obj_set_height(ui_LabelL8, LV_SIZE_CONTENT);

    lv_obj_set_x(ui_LabelL8, -1);
    lv_obj_set_y(ui_LabelL8, 66);

    lv_obj_set_align(ui_LabelL8, LV_ALIGN_CENTER);

    lv_label_set_recolor(ui_LabelL8, true);

    lv_label_set_text(ui_LabelL8, "L-8 : 1024");

    lv_obj_clear_flag(ui_LabelL8, LV_OBJ_FLAG_CLICKABLE);

    lv_obj_set_style_text_align(ui_LabelL8, LV_TEXT_ALIGN_LEFT, LV_PART_MAIN | LV_STATE_DEFAULT);

    // LabelR1

    ui_LabelR1 = lv_label_create(ui_ScreenMAIN);

    lv_obj_set_width(ui_LabelR1, LV_SIZE_CONTENT);
    lv_obj_set_height(ui_LabelR1, LV_SIZE_CONTENT);

    lv_obj_set_x(ui_LabelR1, -81);
    lv_obj_set_y(ui_LabelR1, 95);

    lv_obj_set_align(ui_LabelR1, LV_ALIGN_CENTER);

    lv_label_set_recolor(ui_LabelR1, true);

    lv_label_set_text(ui_LabelR1, "R-1 : 1024");

    lv_obj_clear_flag(ui_LabelR1, LV_OBJ_FLAG_CLICKABLE);

    lv_obj_set_style_text_align(ui_LabelR1, LV_TEXT_ALIGN_LEFT, LV_PART_MAIN | LV_STATE_DEFAULT);

    // LabelR2

    ui_LabelR2 = lv_label_create(ui_ScreenMAIN);

    lv_obj_set_width(ui_LabelR2, LV_SIZE_CONTENT);
    lv_obj_set_height(ui_LabelR2, LV_SIZE_CONTENT);

    lv_obj_set_x(ui_LabelR2, -1);
    lv_obj_set_y(ui_LabelR2, 95);

    lv_obj_set_align(ui_LabelR2, LV_ALIGN_CENTER);

    lv_label_set_recolor(ui_LabelR2, true);

    lv_label_set_text(ui_LabelR2, "R-2 : 1024");

    lv_obj_clear_flag(ui_LabelR2, LV_OBJ_FLAG_CLICKABLE);

    lv_obj_set_style_text_align(ui_LabelR2, LV_TEXT_ALIGN_LEFT, LV_PART_MAIN | LV_STATE_DEFAULT);

    // LabelR3

    ui_LabelR3 = lv_label_create(ui_ScreenMAIN);

    lv_obj_set_width(ui_LabelR3, LV_SIZE_CONTENT);
    lv_obj_set_height(ui_LabelR3, LV_SIZE_CONTENT);

    lv_obj_set_x(ui_LabelR3, 77);
    lv_obj_set_y(ui_LabelR3, 95);

    lv_obj_set_align(ui_LabelR3, LV_ALIGN_CENTER);

    lv_label_set_recolor(ui_LabelR3, true);

    lv_label_set_text(ui_LabelR3, "R-3 : 1024");

    lv_obj_clear_flag(ui_LabelR3, LV_OBJ_FLAG_CLICKABLE);

    lv_obj_set_style_text_align(ui_LabelR3, LV_TEXT_ALIGN_LEFT, LV_PART_MAIN | LV_STATE_DEFAULT);

    // LabelR4

    ui_LabelR4 = lv_label_create(ui_ScreenMAIN);

    lv_obj_set_width(ui_LabelR4, LV_SIZE_CONTENT);
    lv_obj_set_height(ui_LabelR4, LV_SIZE_CONTENT);

    lv_obj_set_x(ui_LabelR4, -79);
    lv_obj_set_y(ui_LabelR4, 117);

    lv_obj_set_align(ui_LabelR4, LV_ALIGN_CENTER);

    lv_label_set_recolor(ui_LabelR4, true);

    lv_label_set_text(ui_LabelR4, "R-4 : 1024");

    lv_obj_clear_flag(ui_LabelR4, LV_OBJ_FLAG_CLICKABLE);

    lv_obj_set_style_text_align(ui_LabelR4, LV_TEXT_ALIGN_LEFT, LV_PART_MAIN | LV_STATE_DEFAULT);

    // LabelR5

    ui_LabelR5 = lv_label_create(ui_ScreenMAIN);

    lv_obj_set_width(ui_LabelR5, LV_SIZE_CONTENT);
    lv_obj_set_height(ui_LabelR5, LV_SIZE_CONTENT);

    lv_obj_set_x(ui_LabelR5, -1);
    lv_obj_set_y(ui_LabelR5, 117);

    lv_obj_set_align(ui_LabelR5, LV_ALIGN_CENTER);

    lv_label_set_recolor(ui_LabelR5, true);

    lv_label_set_text(ui_LabelR5, "R-5 : 1024");

    lv_obj_clear_flag(ui_LabelR5, LV_OBJ_FLAG_CLICKABLE);

    lv_obj_set_style_text_align(ui_LabelR5, LV_TEXT_ALIGN_LEFT, LV_PART_MAIN | LV_STATE_DEFAULT);

    // LabelR6

    ui_LabelR6 = lv_label_create(ui_ScreenMAIN);

    lv_obj_set_width(ui_LabelR6, LV_SIZE_CONTENT);
    lv_obj_set_height(ui_LabelR6, LV_SIZE_CONTENT);

    lv_obj_set_x(ui_LabelR6, 78);
    lv_obj_set_y(ui_LabelR6, 117);

    lv_obj_set_align(ui_LabelR6, LV_ALIGN_CENTER);

    lv_label_set_recolor(ui_LabelR6, true);

    lv_label_set_text(ui_LabelR6, "R-6 : 1024");

    lv_obj_clear_flag(ui_LabelR6, LV_OBJ_FLAG_CLICKABLE);

    lv_obj_set_style_text_align(ui_LabelR6, LV_TEXT_ALIGN_LEFT, LV_PART_MAIN | LV_STATE_DEFAULT);

    // LabelR7

    ui_LabelR7 = lv_label_create(ui_ScreenMAIN);

    lv_obj_set_width(ui_LabelR7, LV_SIZE_CONTENT);
    lv_obj_set_height(ui_LabelR7, LV_SIZE_CONTENT);

    lv_obj_set_x(ui_LabelR7, -80);
    lv_obj_set_y(ui_LabelR7, 140);

    lv_obj_set_align(ui_LabelR7, LV_ALIGN_CENTER);

    lv_label_set_recolor(ui_LabelR7, true);

    lv_label_set_text(ui_LabelR7, "R-7 : 1024");

    lv_obj_clear_flag(ui_LabelR7, LV_OBJ_FLAG_CLICKABLE);

    lv_obj_set_style_text_align(ui_LabelR7, LV_TEXT_ALIGN_LEFT, LV_PART_MAIN | LV_STATE_DEFAULT);

    // LabelR8

    ui_LabelR8 = lv_label_create(ui_ScreenMAIN);

    lv_obj_set_width(ui_LabelR8, LV_SIZE_CONTENT);
    lv_obj_set_height(ui_LabelR8, LV_SIZE_CONTENT);

    lv_obj_set_x(ui_LabelR8, 0);
    lv_obj_set_y(ui_LabelR8, 140);

    lv_obj_set_align(ui_LabelR8, LV_ALIGN_CENTER);

    lv_label_set_recolor(ui_LabelR8, true);

    lv_label_set_text(ui_LabelR8, "R-8 : 1024");

    lv_obj_clear_flag(ui_LabelR8, LV_OBJ_FLAG_CLICKABLE);

    lv_obj_set_style_text_align(ui_LabelR8, LV_TEXT_ALIGN_LEFT, LV_PART_MAIN | LV_STATE_DEFAULT);

}
void ui_ScreenSTARTUP_screen_init(void)
{

    // ScreenSTARTUP

    ui_ScreenSTARTUP = lv_obj_create(NULL);

    lv_obj_clear_flag(ui_ScreenSTARTUP, LV_OBJ_FLAG_SCROLLABLE);

    // Label4_copy

    ui_Label4_copy = lv_label_create(ui_ScreenSTARTUP);

    lv_obj_set_width(ui_Label4_copy, LV_SIZE_CONTENT);
    lv_obj_set_height(ui_Label4_copy, LV_SIZE_CONTENT);

    lv_obj_set_x(ui_Label4_copy, 0);
    lv_obj_set_y(ui_Label4_copy, -20);

    lv_obj_set_align(ui_Label4_copy, LV_ALIGN_CENTER);

    lv_label_set_text(ui_Label4_copy, "- ZRR-ServoDriver -");

    lv_obj_clear_flag(ui_Label4_copy, LV_OBJ_FLAG_CLICKABLE);

    // Anim_startup_Animation(ui_Label4_copy, 0);

    // Label4

    ui_Label4 = lv_label_create(ui_ScreenSTARTUP);

    lv_obj_set_width(ui_Label4, LV_SIZE_CONTENT);
    lv_obj_set_height(ui_Label4, LV_SIZE_CONTENT);

    lv_obj_set_x(ui_Label4, 0);
    lv_obj_set_y(ui_Label4, 0);

    lv_obj_set_align(ui_Label4, LV_ALIGN_CENTER);

    lv_label_set_text(ui_Label4, "- BOOTING -");

    lv_obj_clear_flag(ui_Label4, LV_OBJ_FLAG_CLICKABLE);

    // Anim_startup_Animation(ui_Label4, 500);

    // Spinner1

    ui_Spinner1 = lv_spinner_create(ui_ScreenSTARTUP, 1000, 90);

    lv_obj_set_width(ui_Spinner1, 200);
    lv_obj_set_height(ui_Spinner1, 200);

    lv_obj_set_x(ui_Spinner1, 0);
    lv_obj_set_y(ui_Spinner1, -10);

    lv_obj_set_align(ui_Spinner1, LV_ALIGN_CENTER);

    lv_obj_clear_flag(ui_Spinner1, LV_OBJ_FLAG_CLICKABLE);

    lv_obj_set_style_arc_width(ui_Spinner1, 2, LV_PART_MAIN | LV_STATE_DEFAULT);

    lv_obj_set_style_arc_width(ui_Spinner1, 2, LV_PART_INDICATOR | LV_STATE_DEFAULT);

    // Anim_startup_Animation(ui_Spinner1, 600);

}

void ui_init(void)
{
    ui_ScreenMAIN_screen_init();
    ui_ScreenSTARTUP_screen_init();

    // Anim_startup_Animation(ui_ScreenSTARTUP, 0);
    Anim_startup_Animation(ui_ScreenMAIN, 0);

    lv_disp_load_scr(ui_ScreenMAIN);
}

